package com.qf.day11;

import java.util.Iterator;

/**
 * 产生10个随机的字符串
 */
public class StrIterator implements Iterator<String> {

    public static void main(String[] args) {
        // 每个iterator对象，可以被调用10次next()方法返回字符串
        Iterator<String> iterator = new StrIterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }

    }

    @Override
    public boolean hasNext() {
        return false;
    }

    @Override
    public String next() {
        return null;
    }
}
